package com.hsh.gaoqianlianmeng.domain;

import com.hsh.gaoqianlianmeng.anno.Alia;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Data
@Accessors(chain = true)
public class PDDExport {

    @Alia("商品")
    private String productName;

    @Alia("订单号")
    private String no;

    @Alia("商品数量(件)")
    private Integer num;

    /**
     * 商品编码
     */
    @Alia("商家编码-规格维度")
    private String productCode;

    @Alia("商家实收金额(元)")
    private BigDecimal totalPrice;

    @Alia("手机")
    private String customerPhone;

    @Alia("省")
    private String customerProvince;

    @Alia("市")
    private String customerCity;

    @Alia("区")
    private String customerCounty;

    @Alia("详细地址")
    private String customerStreetAddress;

    @Alia("身份证姓名")
    private String customerName;

    @Alia("身份证号码")
    private String customerIdNo;

    private BigDecimal unitPrice;

    private String customerAddress;

    public PDDExport init() {
        unitPrice = this.totalPrice.divide(BigDecimal.valueOf(num), 2, RoundingMode.HALF_UP);
        this.customerAddress = this.customerProvince + this.customerCity + this.customerCounty + this.customerStreetAddress;
        return this;
    }


}